package j20251117;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class Demo1 {
    public static void main(String[] args) {
        try(InputStream fis = new FileInputStream("test.txt")){
            int len;
            byte[] buffer = new byte[1024];
            while((len = fis.read(buffer)) != -1){
                System.out.print(new String(buffer, 0, len));
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
